package com.wang.designpattern.decorator;

import com.wang.designpattern.decorator.component.LongBlack;
import com.wang.designpattern.decorator.decorator.Chocolate;
import com.wang.designpattern.decorator.decorator.Milk;

public class CofferBar {

    public static void main(String[] args) {

        // 1.点一份LongBlack
        Drink order = new LongBlack();
        System.out.println(order.cost());
        System.out.println(order.getDesc());
        System.out.println("**************************************************");

        // 2.加入一份牛奶
        order = new Milk(order);
        System.out.println(order.cost());
        System.out.println(order.getDesc());
        System.out.println("**************************************************");

        // 3.加入一份巧克力
        order = new Chocolate(order);
        System.out.println(order.cost());
        System.out.println(order.getDesc());
        System.out.println("**************************************************");

        // 3.再加入一份巧克力
        order = new Chocolate(order);
        System.out.println(order.cost());
        System.out.println(order.getDesc());
        System.out.println("**************************************************");
    }
}
